Ext.define('PrjAPLean.view.paapply.RegionalAllocationPanel', {
	extend : 'Ext.panel.Panel',
	alias : 'widget.regionalallocationpanel',
	
	requires : [ 'PrjAPLean.view.paapply.RegionalAllocationPanelViewModel', 
	             'PrjAPLean.view.paapply.RegionalAllocationPanelViewController', 
	             'Ext.form.Panel', 
	             'Ext.form.RadioGroup', 
	             'Ext.form.field.Radio', 
	             'Ext.form.field.Date', 
	             'Ext.toolbar.Toolbar', 
	             'Ext.button.Button', 
	             'Ext.grid.Panel', 
	             'Ext.grid.column.Check', 
	             'Ext.grid.column.Boolean', 
	             'Ext.grid.View', 
	             'Ext.grid.column.Date'
	             ],

	viewModel : {
		type : 'regionalallocationvm'
	},
	controller : 'regionalallocationvc',
	itemId : 'regionalallocationpanel',
	autoScroll:true,
	border : false,
	layout: 'vbox',
	items : [ {
		  xtype : 'fieldset',
		  collapsible : true,
		  layout : 'hbox',
		  margin:'5',
		  width:1100,
		  title:'填写Pricing分配明细',
		  items : [ {
			  xtype : 'fieldset',
			  collapsible : false,
			  layout : 'vbox',
			  margin:'5',
			  items : [ {
		        	    xtype:'container',
						layout:'hbox',
						margin:'5 0 5 0',
						defaults:{
								allowBlank:false,
								labelAlign : 'right',
								labelWidth : 170
						},
						items:[ {
				        	xtype: 'combobox',
				            fieldLabel: '月',
				            labelAlign:'right',
				            name:'month',
				            itemId:'month',
				            displayField: 'name',
				            valueField: 'id',
				            editable: false,
				            store: Ext.create('Ext.data.Store',{
				            	fields: ['id', 'name'],
				                data : [
				                    {"id":"1", "name":"01"},
				                    {"id":"2", "name":"02"},
				                    {"id":"3", "name":"03"},
				                    {"id":"4", "name":"04"},
				                    {"id":"5", "name":"05"},
				                    {"id":"6", "name":"06"},
				                    {"id":"7", "name":"07"},
				                    {"id":"8", "name":"08"},
				                    {"id":"9", "name":"09"},
				                    {"id":"10", "name":"10"},
				                    {"id":"11", "name":"11"},
				                    {"id":"12", "name":"12"},
				            ]})
				        },
				        {
							xtype : 'combobox',
							fieldLabel : '小区',
							name : 'channel',
							editable : false,
							valueField : 'id',
							displayField : 'name'
					  	},
					  	{
							xtype : 'combobox',
							fieldLabel : 'BG',
							name : 'channel',
							editable : false,
							valueField : 'id',
							displayField : 'name'
					  	} ] 
				 	},
				 	{
		        	    xtype:'container',
						layout:'hbox',
						margin:'5 0 5 0',
						defaults:{
								allowBlank:false,
								labelAlign : 'right',
								labelWidth : 170
						},
						items:[ {
									xtype : 'combobox',
									fieldLabel : 'Category',
									name : 'channel',
									editable : false,
									valueField : 'id',
									displayField : 'name'
							  	},
							  	{
									xtype : 'numberfield',
									decimalPrecision:3,
									hideTrigger: true,
									fieldLabel : 'Amount',
									labelAlign : 'right',
									name : 'amount'
								},
							  	{
									xtype : 'button',
									text : '添加',
									style:'margin-left:180px;',
									iconCls: 'common_icon_save',
									handler : 'onAddClick'
								 } ] 
				 	} ]
		  }]
	  },
	  {
		    xtype : 'fieldset',
			collapsible : true,
			layout : 'vbox',
			width:1100,
			margin : '5 5 5 5',
			title:'Pricing 分配明细',
			items : [ {
	        	  xtype : 'container',
	        	  layout : 'vbox',
	        	  defaults:{
	        		  labelAlign : 'right'
	        	  },
	        	  items : [ {
						xtype : 'toolbar',
						dock : 'top',
						border : 0,
						layout : {
							type : 'hbox'
						},
						items : [ 
							{
								xtype : 'button',
								iconCls : 'common-icon-delete',
								text : 'Delete',
								listeners : {
									click : 'onDelClick'
								}
							}]
						},
						{
							xtype : 'gridpanel',
							itemId : 'activityGrid',
							reference : 'activityGrid',
							width:1100,
							autoScroll : true,
							//bind : '{activitys}',
							viewConfig : {
								enableTextSelection : true
							},
							columns : [ {
								xtype : 'gridcolumn',
								text : 'id',
								labelAlign : 'right',
								name : 'id',
								dataIndex : 'id',
								hidden : true
							}, 
							{
								xtype : 'gridcolumn',
								text : '序号',
								labelAlign : 'right',
								name : 'sequence',
								dataIndex : 'sequence'
							}, 
							{
								xtype : 'gridcolumn',
								text : '月',
								labelAlign : 'right',
								name : 'channel',
								dataIndex : 'channel'
							}, 
							{
								xtype : 'gridcolumn',
								text : '小区',
								labelAlign : 'right',
								name : 'activity',
								dataIndex : 'activity'
							},
							{
								xtype : 'gridcolumn',
								text : 'BG',
								labelAlign : 'right',
								name : 'channel',
								dataIndex : 'channel'
							}, 
							{
								xtype : 'gridcolumn',
								text : 'Category',
								labelAlign : 'right',
								name : 'channel',
								dataIndex : 'channel'
							}, 
							{
								xtype : 'gridcolumn',
								text : 'Amount',
								labelAlign : 'right',
								name : 'amount',
								dataIndex : 'amount'
							}
						] 
				} ]
			} ]
	  } ]
});
